#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
/*int i;
int main()
{
    i--;
    if (i > sizeof(i))
    {
        printf(">\n");
    }
    else
    {
        printf("<\n");
    }
    return 0;
}
*/
int main() {
    int arr1[5] = {0};
    int arr2[6] = {0};

    int i = 0;
    for (i = 0; i < 5; i++) {
        scanf("%d", &arr1[i]);
    }
    for (i = 0; i < 6; i++) {
        scanf("%d", &arr2[i]);
    }
    int arr3[11] = { 0 };
    i = 0;
    int j = 0;
    int k = 0;
    while (i < 5 && j < 6) {
        if (arr1[i] < arr2[j]) {
            arr3[k] = arr1[i];
            i++; k++;
        }
        if (arr1[i] > arr2[j]) {
            arr3[k] = arr2[j];
            j++; k++;
        }
    }
    if (i == 0) {
        while (j < 6) {
            arr3[k] = arr2[j];
            k++;
            j++;
        }
    }
    else {
        while (i < 5) {
            arr3[k] = arr1[i];
            k++;
                i++;
        }
        i = 0;
        for (i = 0; i < 11; i++) {
            printf("%d", arr3[i]);
        }
    }


}